import Vue from 'vue'
import VueRouter from 'vue-router'

/* Layout */
import Layout from '@/layout'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'index',
    component: Layout,
    redirect: 'homepage',
    children: [
      {
        path: 'homepage',
        name: 'Homepage',
        component: () => import('@/views/homepage/index')
      },
      {
        path: 'project',
        name: 'Project',
        component: () => import('@/views/project/index')
      },
      {
        path: 'image',
        name: 'Image',
        component: () => import('@/views/image/index')
      },
      {
        path: 'diary',
        name: 'Diary',
        component: () => import('@/views/diary/index')
      },
      {
        path: 'archives',
        name: 'Archives',
        component: () => import('@/views/archives/index')
      },
      {
        path: 'about',
        name: 'About',
        component: () => import('@/views/about/index')
      },
      {
        path: 'message',
        name: 'Message',
        component: () => import('@/views/message/index')
      }
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
